package dcl.software.filesync.server;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.reflect.FieldUtils;


public class BaseDomain {
	
	public Map<String, Object> getPropertyMap() throws IllegalAccessException
	{
		Field[] fields = this.getClass().getDeclaredFields();
		
		Map<String, Object> domainMap = new HashMap<String, Object>();
		for(Field field : fields)
		{
			String name = field.getName();
			Object readField = FieldUtils.readField(field, this, true);
			//if(readField instanceof byte[])
			//	domainMap.put(name, translate((byte[])readField));
			//else
				domainMap.put(name, readField);
		}
		return domainMap;
	}
}
